import axios from "axios";
const API = axios.create({
  baseURL: "https://lamp.localbird.cn",
  timeout: 2000,
  headers: {
    "Content-Type": "application/json;charset=utf-8"
  }
});
// 请求拦截
API.interceptors.request.use(config => {
  config.headers = config.headers || {};
  if (localStorage.getItem("techAdminToken")) {
    config.headers.TOKEN = localStorage.getItem("techAdminToken") || "";
  }
  return config;
});
// 响应拦截
API.interceptors.response.use(
  respose => {
    return respose;
  },
  err => {
    return Promise.reject(err);
  }
);
export default API;
